/**
 * @author cscadmin
 *
 */
package com.csc.banking.filter;

import java.io.IOException;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.filter.OncePerRequestFilter;

public class CaptchaCaptureFilter extends OncePerRequestFilter {
	 private String recaptcha_response;
	 private String recaptcha_challenge;
	 private String remoteAddr;
	@Override
	protected void doFilterInternal(HttpServletRequest request,
			HttpServletResponse response, FilterChain chain)throws ServletException, IOException {
		
		if (request.getParameter("recaptcha_response_field") != null) {
			   recaptcha_response = request.getParameter("recaptcha_response_field");
			   recaptcha_challenge = request.getParameter("recaptcha_challenge_field");
			   remoteAddr = request.getRemoteAddr();
			  }
		chain.doFilter(request, response);
	}
	public String getRecaptcha_response() {
		return recaptcha_response;
	}
	public void setRecaptcha_response(String recaptcha_response) {
		this.recaptcha_response = recaptcha_response;
	}
	public String getRecaptcha_challenge() {
		return recaptcha_challenge;
	}
	public void setRecaptcha_challenge(String recaptcha_challenge) {
		this.recaptcha_challenge = recaptcha_challenge;
	}
	public String getRemoteAddr() {
		return remoteAddr;
	}
	public void setRemoteAddr(String remoteAddr) {
		this.remoteAddr = remoteAddr;
	}

}